# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com
 
@File:is_today1_0.py
@Time:2024/12/10 14:42

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""
import os
from datetime import datetime

# 文件路径
file_path = '../static/news.md'


def is_today(filename):
    # 获取文件的最后修改时间戳
    modification_time = os.path.getmtime(filename)

    # 将时间戳转换为datetime对象
    last_modified_date = datetime.fromtimestamp(modification_time).date()

    # 获取当前日期
    current_date = datetime.now().date()

    # 比较文件最后修改日期和当前日期
    istoday = last_modified_date == current_date

    # 根据比较结果返回真或假
    # print(is_today)
    return istoday


if __name__ == "__main__":
    print(not is_today(file_path))